<template>
    <div>
        <select name="" id="" v-model="type">
            <option :value="1" selected>APP订票</option>
            <option :value="0">前台兑换</option>
        </select>
        <ul>
            <li v-for="data in filterCinemaList(type)" :key="data.cinemaId">
                {{ data.name }}
            </li>
        </ul>
    </div>
</template>
<script>
import { mapMutations, mapState,mapActions,mapGetters } from 'vuex'
export default {
    data() {
        return {
        type: 1
      }  
    },
    methods: {
        ...mapActions('CinemaModule', ['getCinemaList']),

    },
    computed: {
        ...mapState('CinemaModule',['cinemaList']),
      ...mapGetters('CinemaModule', ['filterCinemaList'])
    },
    mounted() {
        console.log('影院');
        if (this.cinemaList.length === 0) {
            // 请求数据 dispatch
            // this.$store.dispatch('getCinemaList',"参数演示");
            this.getCinemaList('参数演示')
        } else {
            console.log('缓存');
        }
    },
}
</script>

<style scoped lang="scss">
    li{
        padding: 10px;
    }
</style>